Image processing device, image processing method, program, and information storage medium

ABSTRACT

Provided is an image processing device capable of specifying a character area included in an image even if a variable-density difference in an area included in the image other than the character area is large. A feature point specifying unit specifies corners of edges in a target image as feature points. An area obtaining unit obtains, based on a specified result of the feature point specifying unit, an area including a plurality of feature points aligned in a substantially straight line. A character area specifying unit specifies a character area in the target image based on the area obtained by the area obtaining unit.

TECHNICAL FIELD

The present invention relates to an image processing device, an imageprocessing method, a program, and an information storage medium.

BACKGROUND ART

Ina field of image processing, there is a case where one might want todetermine whether an image includes a character area inserted by animage editing, or specify (detect) all character areas inserted by theimage editing in the image.

For example, in a case of a virtual mall site, one might want to extractan item image (a product image) that does not have text such as “freeshipping”, “Grand Prize Winner” or the like from item images of shops inthe virtual mall, and use the item image on a top page or the like. Inthis case, it is necessary to determine whether the item image includesthe character area inserted by the image editing.

Further, in the virtual mall site, one might want to check whether textthat is illegal under the Pharmaceutical Affairs Law or the like, forexample, is written on an item image. In this case, it is necessary tospecify every character area inserted by the image editing from theimage.

As a technology to specify a character area included in an image, thetechnology disclosed in Patent Literature 1 is known, for example.Patent Literature 1 discloses technology for specifying a character areaof advertisement leaflets in which characters and images are laid out(see paragraphs 0019 and 0020, and FIG. 3). In the technology disclosedin Patent Literature 1, image data is separated for each color, and aplurality of pieces of color image data is thereby generated. Further,an edge part is specified using the variable density of image data, andan area that only includes amount of edges less than a predeterminedvalue is specified as a photograph area. A character area is thenspecified for each piece of color image data based on the photographarea.

CITATION LIST Patent Literature Patent Literature 1: JP2010-225112ASUMMARY OF INVENTION Technical Problem

In a case where a variable-density difference in a photograph areaincluded in an image is larger, the amount of edges of the photographarea becomes larger. In Patent Literature 1, an area that only includesthe amount of edges less than the predetermined value is specified asthe photograph area. As such, when a variable-density difference in thephotograph area is large, the photograph area is not specifiedaccurately, and the character area may not be specified.

One or more embodiments of the present invention have been conceived inview of the above, and an object thereof is to provide an imageprocessing device, an image processing method, a program, and aninformation storage medium capable of specifying a character areaincluded in an image even when a variable-density difference in an areaincluded in the image other than the character area is large.

Solution to Problem

In order to solve the above described problems, an image processingdevice according to the present invention includes feature pointspecifying means for specifying corners of edges in a target image asfeature points, area obtaining means for obtaining an area based on aspecified result of the feature point specifying means, the areaincluding a plurality of feature points aligned in a substantiallystraight line, and character area specifying means for specifying acharacter area in the target image based on the area obtained by thearea obtaining means.

An image processing method according to the present invention includes afeature point specifying step of specifying corners of edges in a targetimage as feature points, an area obtaining step of obtaining an areabased on a specified result of the feature point specifying step, thearea including a plurality of feature points aligned in a substantiallystraight line, and a character area specifying step of specifying acharacter area in the target image based on the area obtained in thearea obtaining step.

A program according to the present invention is a program for causing acomputer to function as feature point specifying means for specifyingcorners of edges in a target image as feature points, area obtainingmeans for obtaining an area based on a specified result of the featurepoint specifying means, the area including a plurality of feature pointsaligned in a substantially straight line, and character area specifyingmeans for specifying a character area in the target image based on thearea obtained by the area obtaining means.

A computer-readable information storage medium according to the presentinvention is a computer-readable information storage medium storing theprogram as described.

In an embodiment of the present invention, the character area specifyingmeans may specify the character area based on areas that are close toeach other among areas obtained by the area obtaining means.

In an embodiment of the present invention, the area obtaining means mayobtain an area including a plurality of feature points that are alignedin a substantially straight line and have a same or similar color.

In an embodiment of the present invention, the character area specifyingmeans may specify the character area by combining areas that are closeto each other among areas obtained by the area obtaining means. In acase where a first area and a second area, which are obtained by thearea obtaining means, are close to each other, the character areaspecifying means may specify the character area by combining the firstarea and the second area even when a color of a feature point includedin the first area is neither a same as nor similar to a color of afeature point included in the second area.

In an embodiment of the present invention, the feature point specifyingmeans may include first specifying means for specifying corners of edgesin the target image as first feature points, and second specifying meansfor specifying corners of edges in a reduced image, which is obtained byreducing the target image, as second feature points. The area obtainingmeans may include first obtaining means for obtaining an area based on aspecified result of the first specifying means, the area including aplurality of first feature points aligned in a substantially straightline, and second obtaining means for obtaining an area based on aspecified result of the second specifying means, the area including aplurality of second feature points aligned in a substantially straightline. The character area specifying means may specify the character areain the target image based on the area obtained by the first obtainingmeans and the area obtained by the second obtaining means. Thespecification by the second specifying means and the obtainment by thesecond obtaining means may be repeated while the reduced image isgradually reduced. In other words, the specification by the secondspecifying means and the obtainment by the second obtaining means may berepeated until the reduced image is reduced enough.

In an embodiment of the present invention, the character area specifyingmeans may include extracting means for extracting, using a graph cutmethod, an area included in the character area among from areas obtainedby the area obtaining means, and means for specifying the character areain the target image based on the area extracted by the extracting means.

Advantageous Effects of Invention

According to the present invention, it is possible to specify acharacter area included in an image even when a variable-densitydifference in an area included in the image other than the characterarea is large. Further, according to the present invention, it ispossible to prevent an area having a large variable-density differencein an image including no character from being specified in error as acharacter area. In other words, even when an image including nocharacter has a large variable-density difference, it is possible todetermine that a character is not included in the image.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 A diagram illustrating an example of a hardware configuration ofan image processing device according to an embodiment of the presentinvention.

FIG. 2 A diagram illustrating an example of an item image.

FIG. 3 A functional block diagram illustrating an example of functionsimplemented in the image processing device.

FIG. 4 A diagram illustrating an example of processing executed in theimage processing device.

FIG. 5 A diagram explaining processing for determining whether or not apixel corresponds to a corner.

FIG. 6 A diagram illustrating an example of a feature point specified bythe image processing device.

FIG. 7 A diagram illustrating an example of a super corner obtained bythe image processing device.

FIG. 8 A diagram explaining a graph cut method.

FIG. 9 A diagram explaining combining super corners.

FIG. 10A A diagram explaining meaning of specifying a super corner in areduced image.

FIG. 10B A diagram explaining meaning of specifying a super corner in areduced image.

FIG. 10C A diagram explaining meaning of specifying a super corner in areduced image.

FIG. 11 A diagram explaining integrating combined areas.

DESCRIPTION OF EMBODIMENTS

An example of an embodiment of the present invention will be describedbelow in detail with reference to the accompanying drawings.

FIG. 1 shows an example of a hardware configuration of an imageprocessing device 10 according to an embodiment of the presentinvention. The image processing device 10 is implemented by, forexample, a server computer, a desktop computer, a laptop computer, atablet computer, or the like.

As shown in FIG. 1, the image processing device 10 includes a controlunit 11, a storage unit 12, an optical disc drive unit 13, acommunication interface unit 14, an operation unit 15, a display unit16, and an audio output unit 17.

The control unit 11 includes, for example, one or more microprocessors,and executes information processing according to an operating system ora program stored in the storage unit 12. The storage unit 12 includes,for example, a RAM, a hard disk, and a solid-state drive. The opticaldisc drive unit 13 reads a program and data stored in an optical disc(information storage medium).

The program and the data are provided to the storage unit 12 through theoptical disc. That is, the program and the data are read from theoptical disc by the optical disc drive unit 13, and stored in thestorage unit 12. The image processing device 10 may include a componentfor reading a program and data stored in an information storage mediumother than the optical disc (e.g., memory card). The program and thedata may be provided to the storage unit 12 through an informationstorage medium other than the optical disc.

The communication interface unit 14 is an interface for connecting theimage processing device 10 with a communication network. The imageprocessing device 10 can exchange data with other devices through thecommunication network. The program and the data may be provided to thestorage unit 12 through the communication network.

The operation unit 15 is used for operation of the user. For example, akeyboard, a mouse, a touchpad, a touch panel, a stick (lever) or thelike corresponds to the operation unit 15. For example, the display unit16 is a liquid crystal display, an organic EL display or the like, andthe audio output unit 17 is speakers, headphones or the like.

The image processing device 10 can access a database 20. The database 20may be implemented in a device other than the image processing device 10(e.g., server), or implemented in the image processing device 10.

The database 20 stores images. For example, the database 20 stores anitem image, which is used in a virtual mall site provided by a webserver (not shown). That is, the database 20 stores the item imageprepared by staff of the shop in the virtual mall. For example, thedatabase 20 stores the item image that is a photograph image of the itemwith text such as “free shipping”, “Grand Prize Winner” or the likewritten thereon by the staff of the shop.

FIG. 2 shows an example of an item image stored in the database 20. Theitem image 30 shown in FIG. 2 indicates a photograph image of an item(beckoning cat) with text 32 (character string) of kanjis (Chinesecharacters used in Japanese) meaning “Japan.” Typically, it is often thecase that an item image 30 like this has the text 32 written thereon inan eye-catching color that is different from colors of the item. In manycases, the text 32 is written in a single color and aligned inlongitudinal, lateral, or oblique direction.

In the following, technologies are described for specifying an area(character area), in which the text 32 is written by image editing, fromthe item image 30 shown in FIG. 2.

FIG. 3 is a functional block diagram illustrating functional blocksrelated to the present invention out of those implemented by the imageprocessing device 10. As shown in FIG. 3, the image processing device 10includes a feature point specifying unit 40, an area obtaining unit 42,and a character area specifying unit 44. The functional blocks shown inFIG. 3 are implemented by the control unit 11 of the image processingdevice 10.

The feature point specifying unit 40 specifies corners of edges of thetarget image as the feature points. Here, “corners of edges” areintersections of the edges in the target image.

The feature point specifying unit 40 includes a first specifying unit40A and a second specifying unit 40B. The first specifying unit 40Aspecifies the corners of the edges in the target image as first featurepoints. The second specifying unit 40B specifies corners of edges in areduced image, which is obtained by reducing the target image, as secondfeature points.

Functions of the feature point specifying unit 40, the first specifyingunit 40A, and the second specifying unit 40B are described in detaillater (see step S103 of FIG. 4 described below).

An area obtaining unit 42 obtains an area that includes feature pointsaligned in a substantially straight line based on the specified resultof the feature point specifying unit 40.

The area obtaining unit 42 includes a first obtaining unit 42A and asecond obtaining unit 42B. The first obtaining unit 42A obtains an areathat includes first feature points aligned in a substantially straightline based on the specified result of the first specifying unit 40A. Thesecond obtaining unit 42B obtains an area that includes second featurepoints aligned in a substantially straight line based on the specifiedresult of the second specifying unit 40B.

Functions of the area obtaining unit 42, the first obtaining unit 42A,and the second obtaining unit 42B are described in detail later (seestep S104 of FIG. 4 described below).

The character area specifying unit 44 specifies a character area in thetarget image based on the area obtained by the area obtaining unit 42.For example, the character area specifying unit 44 specifies thecharacter area in the target image based on the area obtained by thefirst obtaining unit 42A and the area obtained by the second obtainingunit 42B.

More specifically, the character area specifying unit 44 specifies thecharacter area in the target image based on the areas that are close toeach other among those obtained by the area obtaining unit 42 (firstobtaining unit 42A and second obtaining unit 42B).

For example, the character area specifying unit 44 specifies thecharacter area in the target image by combining the areas that are closeto each other among those obtained by the area obtaining unit 42 (firstobtaining unit 42A and second obtaining unit 42B).

Functions of the character area specifying unit 44 are described indetail later (see steps S105, S106, and S111 of FIG. 4 described below).

FIG. 4 is a flow chart illustrating an example of processing executed bythe image processing device 10 so as to implement the feature pointspecifying unit 40, the area obtaining unit 42, and the character areaspecifying unit 44. The control unit 11 executes the processing shown inFIG. 4 according to a program, so that the control unit 11 functions asthe feature point specifying unit 40, the area obtaining unit 42, andthe character area specifying unit 44. Further description of thefeature point specifying unit 40, the area obtaining unit 42, and thecharacter area specifying unit 44 are given below in reference to FIG.4.

As shown in FIG. 4, firstly, the control unit 11 initializes a variablex to a 100% value (S101). The variable xis used insteps S107 and S108described later.

The control unit 11 obtains an image (e.g., item image 30) from thedatabase 20, and sets the image as a processing target (S102).

Subsequently, the control unit 11 (feature point specifying unit 40 andfirst specifying unit 40A) specifies corners of edges in the processingtarget image as feature points (S103). That is, the control unit 11specifies intersections of the variable-density edges as the featurepoints.

As a method for specifying the feature point (corner), a known method isused. For example, FAST (Features from Accelerated Segment Test) isused. In the following, a case is explained where the FAST method isused, although a method other than the FAST method may be used.

If the processing target image is a color image, the control unit 11converts the processing target image into a gray scale image. Thecontrol unit 11 then determines whether or not each pixel of theprocessing target image corresponds to a corner. FIG. 5 is a diagramexplaining the processing (FAST method) for determining whether or not apixel corresponds to a corner.

For example, if a pixel P0 shown in FIG. 5 satisfies the conditionsdescribed below, the control unit 11 determines that the pixel P0corresponds to a corner (more specifically, a point inside a corner).

Firstly, the control unit 11 specifies pixels on a circle of apredetermined radius with the pixel P0 as the center. In an exampleshown in FIG. 5, the pixels P1-P16 correspond to the pixels on thecircle. Further, the control unit 11 determines whether or not adifference between the value of the pixel P0 and a value of each of thepixels P1-P16 is a threshold value or more.

When there are a predetermined number or more of continuous pixels eachhaving a value greater than the value of the pixel P0 by the thresholdvalue among the pixels P1-P16, the control unit 11 determines that thepixel P0 corresponds to a corner. Further, when there are apredetermined number or more of continuous pixels each having a valueless than the value of the pixel P0 by the threshold value among thepixels P1-P16, the control unit 11 also determines that the pixel P0corresponds to a corner.

In step S103, the control unit 11 executes the processing using the FASTmethod, and thereby obtains FAST feature amount of the processing targetimage. The FAST feature amount includes coordinates of the pointcorresponding to the corner (more specifically, the point inside thecorner) and color information of the point.

FIG. 6 illustrates an example of the feature points specified in stepS103 when the item image 30 shown in FIG. 2 is the processing target.The black and white dots shown in FIG. 6 indicate the feature points 50specified in step S103. FIG. 6 only illustrates the surrounding area ofthe text 32 in the item image 30.

For example, kanjis include a line extending in the longitudinaldirection and a line extending in the lateral direction and theyintersect with each other. In FIG. 6, the points at which the lines inthe kanjis meaning “Japan” intersect with each other are thus specifiedas the feature points 50. These feature points 50 in FIG. 6 are shown byblack dots.

The item image 30 may also include the points on which the edgesextending in different directions intersect in the area where the text32 (kanjis) are not written. As such, in FIG. 6, the feature points 50are also specified in the area in which the text 32 (kanjis) are notwritten. In FIG. 6 these feature points 50 are shown in white dots.

After step S103 is executed, the control unit 11 (area obtaining unit 42and first obtaining unit 42A) obtains a super corner (S104). Here,“super corner” refers to an area including a plurality of feature points50 that are aligned in a substantially straight line and have the sameor similar colors.

As described above, the text 32 written in the item image 30 usually hasa single color, and aligned in a longitudinal or lateral direction. Assuch, the feature points 50 included in the character area generallyhave the features as follows:

(1) the feature points 50 are aligned in straight lines extending inlongitudinal or lateral directions orthogonal to each other.(2) the feature points 50 aligned in one straight line have the same orsimilar colors.

In view of the above features, in step S104, a feature point groupsatisfying all of the following conditions (A) to (D) is specified, anda rectangular area including the feature point group is obtained as asuper corner.

(A) a plurality of feature points 50 are aligned in a substantiallystraight line in a longitudinal, lateral, or oblique direction.(B) the plurality of feature points 50 have the same or similar colors.(C) a distance between the adjacent feature points 50 is equal to orless than a first threshold value.(D) a distance between the feature point 50 on one end and the featurepoint 50 on the other end is equal to or greater than a second thresholdvalue (threshold value greater than first threshold value).

Regarding the condition (A), for example, when a distance from thestraight line to each of a plurality of feature points 50 (i.e., alength of a perpendicular line dropped from each of a plurality offeature points 50 to the straight line) is equal to or less than thethreshold value (e.g., several dots), the control unit 11 regards thesefeature points 50 as aligned in a substantially straight line.

Regarding the condition (B), for example, when the colors of a pluralityof feature points 50 belong to the same color group, which is one of thepredetermined N number (e.g., 32) of color groups, the control unit 11regards these feature points 50 as having the same or similar colors.

The condition (C) is made in order to separate the feature points 50included in the character area from the feature points 50 included inthe area other than the character area as much as possible.

FIG. 7 illustrates an example of the super corner obtained in step S104.In the example of FIG. 7, the super corners 60A-60I are obtained. Forsimplicity, FIG. 7 illustrates apart of the super corners obtained instep S104, but actually the super corner 60 other than the super corners60A-60I is also obtained. In the following description, the supercorners 60A-60I etc. may collectively be referred to as “super corner60.”

After step S104 is executed, the control unit 11 (extracting means)extracts a super corner 60 included in the character area from the supercorners 60 obtained in step S104 (S105).

For example, in the example shown in FIG. 7, the super corners 60A-60Hthat are included in the character area and the super corner 60I that isnot included in the character area are obtained. In step S105, theprocessing is executed for extracting the super corners 60A-60H, whichare included in the character area, from the super corners 60A-60I.

For example, in the image processing device 10, a known graph cut methodis applied in order to extract the super corners 60 included in thecharacter area from the super corners 60 obtained in step S104.

The graph cut method is a known method usually used for separating aforeground and a background of an image, and for example, used forspecifying an object area in an image. In step S105, the graph cutmethod is used in a manner in which the character area is considered asa foreground and other area is considered as a background, in order toextract the super corners 60 included in the character area. Typically,the graph cut method defines a surface (area) called “super pixel” touse, but in step S105 the super corner 60 are used instead of “superpixel.”

FIG. 8 is a diagram illustrating an application of the graph cut method.As shown in FIG. 8, a terminal S corresponding to Source and a terminalT corresponding to Sink are set in the graph cut method. In addition,each super corner 60 is set as a node.

Further, edges TL_(S) are set between the terminal S and respectivenodes (super corners 60), and edges TL_(T) are set between the terminalT and respective nodes (super corners 60). For simplicity, FIG. 8 onlyshows the edges TL_(S) between the terminal S and the super corners 60A,60B, and 60C, and the edges TL_(T) between the terminal T and the supercorners 60A, 60B, and 60C, and other edges TL_(S) and TL_(T) areomitted.

In step S105, the super corner 60 that has more amount of energy on theedge TL_(T) side than on the edge TL_(S) side is extracted as the supercorner 60 included in the character area.

Energy functions are defined as the following equations (1)-(3).

[equation 1]

$\begin{matrix}{{E(L)} = {{\lambda \; {R(L)}} + {B(L)}}} & (1) \\{{{R(L)} = {\sum\limits_{p \in V}{\hat{R}\left( l_{p} \right)}}}{{\hat{R}\left( l_{p} \right)}\text{:}\mspace{14mu} {function}\mspace{14mu} {that}\mspace{14mu} {has}\mspace{14mu} a\mspace{14mu} {smaller}\mspace{14mu} {value}\mspace{14mu} {when}\mspace{14mu} {the}\mspace{14mu} {probability}\mspace{14mu} {that}\mspace{14mu} {feature}\mspace{14mu} {point}\mspace{14mu} p\mspace{14mu} {is}\mspace{14mu} {label}\mspace{14mu} {lp}\mspace{14mu} {is}\mspace{14mu} {higher}}} & (2) \\{{{B(L)} = {\sum\limits_{s_{i} \in S}{\hat{B}\left( s_{i} \right)}}}{s_{i}\text{:}\mspace{14mu} i\text{-}{th}\mspace{14mu} {group}\mspace{14mu} {of}\mspace{14mu} {feature}\mspace{14mu} {points}\mspace{14mu} {aligned}\mspace{14mu} {in}\mspace{14mu} {substantially}\mspace{14mu} {straight}\mspace{14mu} {line}}{S\text{:}\mspace{14mu} {group}\mspace{14mu} {of}\mspace{14mu} s_{i}}} & (3)\end{matrix}$

Further, cost C_(S) regarding the edge TL_(S) is set as the followingequation (4), and cost C_(T) regarding each edge TL_(T) is set as thefollowing equation (5).

[equation 2]

C _(S) =λ{circumflex over (R)}(“bkg”)  (4)

C _(T) =λ{circumflex over (R)}(“text”)  (5)

As described in the equation (2), the function shown in the equation (4)is a function that a value of the function decreases as the probabilitythat the super corner 60 (i.e., feature point 50 included in supercorner 60) is included in the background area (area other than characterarea) increases. As such, a value of the cost C_(S) decreases when thesuper corner 60 is included in the background area.

Similarly, the function shown in the equation (5) is a function that avalue of the function decreases as the probability that the super corner60 (i.e., feature point 50 included in super corner 60) is included inthe character area increases. As such, a value of the cost C_(T)decreases when the super corner 60 is included in the character area.

Typically, density of the feature points 50 is more increased at thecharacter area than the background area, and thus the number of thefeature points 50 included in the super corner 60 in the character areatends to exceed the number of the feature points 50 included in thesuper corner 60 in the background area. Further, the length of the supercorner 60 included in the character area tends to be longer than thelength of the super corner 60 included in the background area. As such,when a super corner 60 includes more number of the feature points 50, itis highly likely that the super corner 60 is included in the characterarea. In addition, when the length of a super corner 60 is longer, it ishighly likely that the super corner 60 is included in the characterarea. As such, the equations (4) and (5) are set such that the costC_(S) increases and the cost C_(T) decreases when the number of thefeature points 50 included in the super corner 60 increases. Further,the equations (4) and (5) are set such that when the length of the supercorner 60 is longer, the cost C_(S) increases and the cost C_(T)decreases.

Although omitted in FIG. 8, an edge NL is set between the nodes (supercorner 60). The cost C_(N) regarding the edge NL between the node s_(i)(super corner 60) and the node s_(j) (super corner 60) is defined asequations (6)-(9) described below.

[equation 3]

$\begin{matrix}{C_{N} = {C_{A} + C_{B} + C_{C}}} & (6) \\{C_{A} = {\exp \left( {- \frac{{eval}\left( {s_{i},s_{j}} \right)}{2\sigma_{amg}^{2}}} \right)}} & (7) \\{C_{B} = {\exp \left( {- \frac{{orth}\left( {s_{i},s_{j}} \right)}{2\sigma_{orth}^{2}}} \right)}} & (8) \\{C_{C} = {\exp \left( {- \frac{{cdist}\left( {s_{i},s_{j}} \right)}{2\sigma_{color}^{2}}} \right)}} & (9)\end{matrix}$

As indicated in the equation (6), the cost C_(N) is the sum of the costC_(A) indicated by the equation (7), the cost C_(B) indicated by theequation (8), and the cost C_(C) indicated by the equation (9).

As discussed above, the text 32 written in the item image 30 usually hasa single color, and aligned in a longitudinal or lateral direction.Thus, as shown in the super corners 60A-60H in FIG. 7, the super corners60 included in the character area are typically arranged substantiallyparallel and close to each other. Alternatively, the super corners 60included in the character area tend to intersect. In addition, the supercorners 60 included in the character area tend to have the same orsimilar colors.

As such, the equations (6)-(9) are set such that the cost C_(N)decreases when two super corners 60 (nodes s_(i) and s_(j)) aresubstantially parallel and close to each other. Further, the equations(6)-(9) are set such that the cost C_(N) decreases when the two supercorners 60 (nodes s_(i) and s_(j)) intersect. Similarly, the equations(6)-(9) are set such that the cost C_(N) decreases when the two supercorners 60 (nodes s_(i) and s_(j)) have the same or similar colors.

For example, the function eval (s_(i), s_(j)) indicated in the equation(7) is a function that a value of the function eval decreases as the twosuper corners 60 (nodes s_(i) and s_(j)) are nearly parallel to eachother or the angle between the two super corners (nodes s_(i) and s_(j))is closer to 90 degrees. As such, the cost C_(A) indicated in theequation (7) decreases when the two super corners 60 (nodes s_(i) ands_(j)) are more parallel and closer to each other.

The equation (7) denotes Gaussian distribution (probabilitydistribution), and the denominator in the equation (7) denotes thevariance. When a value of the variance increases, the tail of theGaussian distribution spreads wider, and when the value of the variancedecreases, the Gaussian distribution has a sharper peak. The value isdetermined by an experiment performed in advance. For example, when apeak is set to be sharp, the probability that a plurality of Gaussiandistributions intersect decreases. As a result, the super corners 60close to each other are likely to be separated. On the other hand, whenthe tail of the Gaussian distribution spreads wider, the probabilitythat a plurality of Gaussian distributions intersect increases. As aresult, the super corners 60 close to each other are unlikely to beseparated.

The function orth (s_(i), s_(j)) indicated in the equation (8) is afunction denoting an orthogonal relationship between the two supercorners 60 (nodes s_(i) and s_(j)) and is a function that a value of thefunction orth decreases when the two super corners 60 (nodes s_(i) ands_(j)) are orthogonal to each other. As such, the cost C_(B) denoted bythe equation (8) decreases as the two super corners 60 (nodes s_(i) ands_(j)) are orthogonal to each other. Similarly to the equation (7), theequation (8) denotes Gaussian distribution (probability distribution),and the denominator in the equation (8) denotes the variance.

Even when the angle between the two super corners 60 is 90 degrees, ifthe two super corners 60 do not actually intersect, it is not determinedthat the two super corners 60 are orthogonal to each other. For example,in an example shown in FIG. 7, the super corners 60A and 60B actuallyintersect, and thus it is determined that the super corners 60A and 60Bare orthogonal to each other. On the other hand, the angle formedbetween the super corners 60A and 60D is substantially 90 degrees butthe super corners 60A and 60D do not actually intersect, and thus it isdetermined that the super corners 60A and 60D are not orthogonal to eachother.

The function cdist (s_(i), s_(j)) indicated in the equation (9) is afunction denoting a difference in colors between the two super corners60 (nodes s_(i) and s_(j)), and is a function that a value of thefunction cdist decreases when the difference in colors is smaller. Assuch, when the difference in colors of between the two super corners 60(nodes s_(i) and s_(j)) is smaller, the cost C_(C) denoted by theequation (9) decreases. In other words, when the color groups to whichthe two super corner 60 (nodes s_(i) and s_(j)) belong is the samegroup, the cost C_(C) denoted by the equation (9) decreases. Similarlyto the equation (7), the equation (9) denotes Gaussian distribution(probability distribution), and the denominator in the equation (9)denotes the variance.

The graph cut method determines how to classify nodes (super corners 60)into a character area or a background area in order to minimize the sumof the above described costs C_(S), C_(T), and C_(N).

That is, in step S105, the nodes (super corners 60) are classified intothe character area or the background area such that the sum of the costsC_(S), C_(T), and C_(N) is minimized, and thereby the super corners 60included in the character area are extracted.

After step S105 is executed, the control unit 11 combines the supercorners 60 extracted in step S105 under the predetermined condition(S106).

For example, the control unit 11 combines the super corners 60 that arearranged close and substantially parallel to each other among thoseextracted in step S105. That is, if a distance between the super corners60 substantially parallel to is less than a reference distance, thecontrol unit 11 combines such super corners 60. Further, for example,the control unit 11 combines the super corners 60 that intersect eachother among those extracted in step S105.

In this case, even when the color group of the feature points 50included in one super corner 60 is different from the color group of thefeature points 50 included in the other super corner 60, in other words,even when the color of the feature points 50 included in one supercorner 60 is neither the same as nor similar to the color of the featurepoints 50 included in the other super corner 60, the control unit 11combines such two super corners 60.

When combining a plurality of super corners 60, the control unit 11generates a rectangular area including such super corners 60 as acombined area that is obtained by combining the super corners 60.

Here, assume that super corners 60A-60H shown in FIG. 7 are extracted asthe super corners 60 included in the character area in step S105.

In this case, the super corners 60A and 60C are close and substantiallyparallel to each other, and thus the control unit 11 combines the supercorners 60A and 60C. Similarly, the super corners 60E and 60F are closeand substantially parallel to each other, and thus the control unit 11combines the super corners 60E and 60F. Further, the super corners 60Gand 60H are close and substantially parallel to each other, and thus thecontrol unit 11 combines the super corners 60G and 60H.

The super corner 60B intersects with the super corners 60A, 60C, 60E,60F, and 60G, and thus the control unit 11 combines the super corner 60Bwith the super corners 60A, 60C, 60E, 60F, and 60G. Similarly, the supercorner 60D intersects with the super corners 60C, 60E, 60F, 60G, and60H, and thus the control unit 11 combines the super corner 60D with thesuper corners 60C, 60E, 60F, 60G, and 60H.

In the case described above, the control unit 11 combines the supercorners 60A-60H. That is, as shown in FIG. 9, the control unit 11obtains a rectangular area including the super corners 60A-60H as acombined area 70 that is obtained by combining the super corners60A-60H.

In a case where the combined area 70 is obtained by combining aplurality of super corners 60, the number of the combined super corners60 is stored in association with the combined area 70. The number isused in step S111 described later.

If each length of a longitudinal side and a lateral side of the combinedarea 70 generated by combining a plurality of super corners 60 is lessthan a first threshold value (e.g., 20 pixels), the plurality of supercorners 60 may not be combined.

Typically, a character area (area in which text is written) is alaterally long or longitudinally long area. In this regard, if a lengthof the longitudinal side and a length of the lateral side of thecombined area 70 are short, it is highly likely that the combined area70 does not correspond to a character area. As such, with theabove-described manner, a combined area 70 that unlikely corresponds toa character area can be ignored, thereby accuracy of specifying thecharacter area can be improved.

Further, if each length of a longitudinal side and a lateral side of thecombined area 70 generated by combining a plurality of super corners 60is greater than a first threshold value (e.g., 20 pixels) and less thana second threshold value (a threshold value greater than a firstthreshold value: e.g., 30 pixels), and a distance between the combinedarea 70 and the closest other super corner 60 is equal to or greaterthan a threshold value, the plurality of super corners 60 may not alsobe combined.

Although a combined area 70 is not so large, if the other super corner60 is located near the combined area 70 (super corners 60), anothercombined area 70 generated by combining the combined area 70 and theother super corner 60 may correspond to the character area. On the otherhand, if the other super corner 60 is not located near a combined area70, such combined area 70 unlikely corresponds to the character area. Assuch, with the above mentioned manner, the combined area 70 thatunlikely corresponds to a character area can be ignored, therebyaccuracy of specifying the character area can be improved.

After step S106 is executed, the control unit 11 multiplies a variable xby 0.5 (S107) to obtain a reduced image, which is obtained by reducingthe original image by x % (S108). In step S107, a value multiplied bythe variable x is not limited to 0.5, but may be another value greaterthan 0 and less than 1.

After step S108 is executed, the control unit 11 determines whether ornot a length of at least one of the longitudinal side and the lateralside of the reduced image obtained in step S108 is equal to or less thana threshold value (e.g., 64 pixels) (S109). If both of the longitudinalside and the lateral side of the reduced image are not equal to and lessthan the threshold value (S109:N), the control unit 11 sets the reducedimage obtained in step S108 as a processing target (S110). Subsequently,the control unit 11 (second specifying unit 40B and second obtainingunit 42B) executes steps S103-S109. In this case, the reduced image isset as the processing target, and the feature points 50 and the supercorners 60 are specified and the combined area 70 is obtained therefrom.

The following describes the meaning of setting a reduced image as aprocessing target to execute steps S103-S106. FIGS. 10A, 10B and 10C arediagrams for explaining the meaning. Here, a case is assumed where akanji meaning “mouth” as shown in FIG. 10(A) is written in an item image30. FIGS. 10A-10C only illustrate areas around the section in which thekanji meaning “mouth” is written.

In this case, in the item image 30 that is not reduced, the featurepoints 50 (first feature points) as shown in FIG. 10A are specified instep S103. Subsequently, the super corners 60J, 60K, 60L, and 60M areobtained in step S104. However, in this case, even when the supercorners 60J-60M are extracted in step S105 as the super corners 60included in the character area, the super corners 60J-60M are not closeto one another and do not intersect, and thus the super corners 60J-60Mare not combined. As a result, the character area is not fully specifiedin this way.

On the other hand, in the reduced item image 30 as shown in FIG. 10B,the feature points 50 (second feature points) as shown in FIG. 10B arespecified in step S103. Subsequently, the super corners 60N, 60O, 60P,and 60Q are obtained in step S104. In actuality, other super corners 60than the super corners 60N-60Q are also obtained, but omitted in FIG.10B for simplicity.

In step S105, when the super corners 60N-60Q are extracted as the supercorners 60 included in the character area, the super corners 60N and 60Ointersect with the super corners 60P and 60Q, and thus the super corners60N-60Q are combined in step S106. That is, as shown in FIG. 10C, thecombined area 70 is generated by combining the super corners 60N-60Q.

The super corners 60 that are close to or intersect each other may notpossibly be specified when a size of the characters written in the image(item image 30) is large. This problem can also be solved by specifyingthe super corners 60 in the reduced image, which is obtained by reducingan image.

As discussed above, the image processing device 10 also specifies asuper corner 60 in a reduced image, which is obtained by reducing anoriginal image, in view of a case where a super corner 60 is not fullyspecified from an image of original size depending on a type or a sizeof the character written in the image (item image 30).

The steps S103-S108 are repeated until the length of at least one of thelongitudinal side and the lateral side of the reduced image becomesequal to or less than the threshold value. The case where “the length ofat least one of the longitudinal side and the lateral side of thereduced image becomes equal to or less than the threshold value” is acase where the reduced image is considerably reduced. If the processingtarget image is reduced to a size that is too small, it adverselyaffects, for example, the specification of the feature points 50 or thesuper corners 60. As such, the image processing device 10 is configurednot to execute steps S103-S108 when the length of at least one of thelongitudinal side and the lateral side of the reduced image is equal toor less than the threshold value.

If the length of at least one of the longitudinal side and the lateralside of the reduced image becomes equal to or less than the thresholdvalue (S109:Y), the control unit 11 specifies the character area byintegrating the combined area 70 obtained in the image of original size(original image) and the combined area 70 obtained in the reduced image(S111).

FIG. 11 is a diagram for explaining integration of the combined area 70.FIG. 11 assumes a case shown in FIGS. 10A-10C. That is, FIG. 11 assumesa case where, for example, the super corners 60J-60M as shown in FIG.10A are obtained in the image of original size, and the combined area 70as shown in FIG. 10C is obtained in the reduced image.

In this case, the control unit 11 enlarges the combined area 70 obtainedin the reduced image according to the size ratio of the reduced image tothe image of original size. That is, the control unit 11 enlarges thecombined area 70 obtained in the reduced image using an enlargementratio for returning the reduced image to the image of original size. Inother words, the control unit 11 obtains the combined area 70 in a casewhere the reduced image is enlarged to the original size. For example,when the reduced image is obtained by reducing the image to 50 percentof its original size, the control unit 11 obtains the combined area 70in a case where the reduced image is enlarged two times.

Subsequently, the control unit 11 obtains the character area byintegrating the combined area 70 obtained in the image of original sizeand an area obtained by enlarging the combined area 70 obtained in thereduced image. That is, the control unit 11 obtains a rectangular areathat includes the combined area 70 obtained in the image of originalsize and the area obtained by enlarging the combined area 70 obtained inthe reduced image. The control unit 11 regards the rectangular area as acharacter area 80.

In the case shown in FIG. 11, the combined area 70 is not obtained inthe image of original size, and thus the control unit 11 regards thearea obtained by enlarging the combined area 70 obtained in the reducedimage as the character area 80.

If one or more characters are written in an image, there should be somenumber of super corners 60 as shown in FIG. 7, for example. As such, ifthe number of super corners 60 obtained in an image (image of originalsize or reduced image) is equal to or less than a predetermined number(e.g., two), such image may be regarded as having no character area. Inthis way, accuracy of specifying the character area can be improved.

If a combined area 70 corresponds to a character area, such combinedarea 70 should include some number of super corners 60. As such, if acombined area 70 obtained in an image (image of original size or reducedimage) is made by combining less than a predetermined number of supercorners 60, such combined area 70 may not be integrated with othercombined areas 70 in step S111. In other words, such combined area 70may not be regarded as a portion of a character area. In this way,accuracy of specifying the character area can be improved.

When a combined area 70 of an image (e.g., an image of original size)and a combined area 70 of another image (e.g., a reduced image) areintegrated and a size of a common area of these combined areas 70 isequal to or less than a predetermined ratio of a size of an areaobtained by integrating these combined areas 70, these combined areas 70may not be integrated. For example, when one end of a combined area 70extending in a longitudinal direction intersects with one end of acombined area 70 extending in a lateral direction, if these combinedareas 70 are integrated, the area mostly including areas other than thecombined areas 70 is regarded as a character area 80. It is notappropriate to regard such area as a character area 80. With theabove-described manner, such area is not regarded as a character area80, thereby accuracy of specifying the character area can be improved.The similar manner may be applied to a case where the super corners 60are combined.

The image processing device 10 described above specifies a corner of anedge (variable-density edge) in an image as a feature point 50. Theimage processing device 10 specifies a character area in the image basedon the feature point 50 in view of a tendency of the feature point 50(corner of edge) included in the character area. As a result, accordingto the image processing device 10 of this embodiment, even when avariable-density difference in an area other than the character area inthe image is large, the character area included in the image can bespecified.

Further, the image processing device 10 according to this embodimentdoes not specify a character area when the image does not include acharacter, even when a variable-density difference is large. That is,when the image does not include a character, the image processing device10 determines that the image does not include a character even when avariable-density difference is large. In other words, the imageprocessing device 10 can be used in order to determine that an imagedoes not include a character area (the image processing device 10 can beused in a case where whether or not a character area is included in animage is determined).

As a method for specifying a character area in an image, a method forspecifying edges (variable-density edges) in the image and specifyingthe character area based on the edges may be also used. However, theimage processing device 10 specifies a character area by specifying onlyedge portion (corner of edge) required for specifying the characterarea, and thereby enabling to reduce an overall processing load comparedto specifying all edges in the image.

As shown in FIG. 6, in a case where lines constituting a character forma corner, two feature points 50 inside and outside the corner areobtained. If the character is bordered, a feature point 50 is alsoobtained for the border. In this way, enough number of feature points 50for specifying a character area can be obtained without using all ofedge portions (variable-density edges) in the image.

The image processing device 10 applies a graph cut method so that asuper corner 60 included in the character area can be extracted from thesuper corners 60 obtained from the image.

Further, the image processing device 10 also obtains a super corner 60from a reduced image. This results in improving accuracy of specifyingthe character area.

When the FAST method is used, a feature point 50 inside a corner oflines constituting a character has a background color, and an outsidefeature point 50 has a character color. When a plurality of supercorners 60 are substantially parallel and close to one another, orintersect, the image processing device 10 combines these super corners60 even when the colors of the feature points 50 included in the supercorners 60 are neither the same nor similar. As a result, according tothe image processing device 10, it is possible to specify all of thecharacter areas.

The present invention is not to be limited to the above describedembodiment.

For example, in the above, the case is explained where a kanji iswritten in an image (see FIG. 2), although the present invention isapplicable to a case where a character other than kanji is written inthe image. For example, the present invention is also applicable to acase where hiragana or katakana is written in an image. In addition, thepresent invention is also applicable to a case where characterscorresponding to language other than Japanese, such as Alphabet,simplified/traditional Chinese, and Hangeul characters, are written inan image.

Further, for example, the present invention is also applicable to a casewhere a character area is specified in an image other than an item image30.

The invention claimed is:
 1. An image processing device comprising: afeature point specifying unit that specifies corners of edges in atarget image as feature points; an area obtaining unit that specifies,based on a specified result of the feature point specifying unit, aplurality of feature points that are aligned in a substantially straightline and have a same or similar color, and obtains an area including thespecified plurality of feature points; and a character area specifyingunit that specifies a character area in the target image based on thearea obtained by the area obtaining unit.
 2. The image processing deviceaccording to claim 1, wherein the character area specifying unitspecifies the character area based on areas that are close to each otheramong areas obtained by the area obtaining unit.
 3. (canceled)
 4. Theimage processing device according to claim 1, wherein the character areaspecifying unit specifies the character area by combining areas that areclose to each other among areas obtained by the area obtaining unit and,wherein, in a case where a first area and a second area, which areobtained by the area obtaining unit, are close to each other, thecharacter area specifying unit specifies the character area by combiningthe first area and the second area even when a color of a feature pointincluded in the first area is neither a same as nor similar to a colorof a feature point included in the second area.
 5. The image processingdevice according to claim 1, wherein the feature point specifying unitcomprises: a first specifying unit that specifies corners of edges inthe target image as first feature points; and a second specifying unitthat specifies corners of edges in a reduced image, which is obtained byreducing the target image, as second feature points, wherein the areaobtaining unit comprises: a first obtaining unit that specifies, basedon a specified result of the first specifying unit, a plurality of firstfeature points that are aligned in a substantially straight line andhave a same or similar color, and obtains an area including thespecified plurality of first feature points; and a second obtaining unitthat specifies, based on a specified result of the second specifyingunit, a plurality of second feature points that are aligned in asubstantially straight line and have a same or similar color, andobtains an area including the specified plurality of second featurepoints, and wherein the character area specifying unit specifies thecharacter area in the target image based on the area obtained by thefirst obtaining unit and the area obtained by the second obtaining unit.6. The image processing device according to claim 1, wherein thecharacter area specifying unit comprises: an extracting unit thatextracts, using a graph cut method, an area included in the characterarea among from areas obtained by the area obtaining unit; and a unitthat specifies the character area in the target image based on the areaextracted by the extracting unit.
 7. A image processing methodcomprising: specifying corners of edges in a target image as featurepoints; specifying, based on a specified result of the specifyingfeature points, a plurality of feature points that are aligned in asubstantially straight line and have a same or similar color, andobtaining an area including the specified plurality of feature points;and specifying a character area in the target image based on theobtained area.
 8. (canceled)
 9. (canceled)